package models;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author luong
 * this entity is mapped to the Position table
 */
@Entity 
@Table (name="PositionPara")
public class HibernatePosition implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column (name = "POS_ID")
	private int pos_id;
	
	@ManyToOne(cascade = CascadeType.REFRESH)
	@JoinColumn (name = "ELEM_POS", referencedColumnName = "WORD_ID")
	private HibernateWord motId;
	
	@ManyToOne(cascade = CascadeType.REFRESH)
	@JoinColumn (name = "CONTAINER_TAG_POS", referencedColumnName = "TAG_ID")
	private HibernateTags paraId;
	
	@Column(name = "position")
	private int position;	

	public HibernatePosition() {}

	public int getId() {
		return pos_id;
	}

	public void setId(int id) {
		this.pos_id = id;
	}

	public HibernateWord getMotId() {
		return motId;
	}

	public void setMotId(HibernateWord motId) {
		this.motId = motId;
	}

	public HibernateTags getParaId() {
		return paraId;
	}

	public void setParaId(HibernateTags paraId) {
		this.paraId = paraId;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}
}
